package com.ksyun.campus.metaserver.util;

import org.I0Itec.zkclient.exception.ZkMarshallingError;
import org.I0Itec.zkclient.serialize.ZkSerializer;

import java.nio.charset.Charset;

public class MyZkSerializer implements ZkSerializer {
	 	@Override
	    public Object deserialize(byte[] bytes) throws ZkMarshallingError {
	        	return new String(bytes, Charset.forName("UTF-8"));
	    }
	 	
	    @Override
	    public byte[] serialize(Object serializable) throws ZkMarshallingError {
	        	return ((String)serializable).getBytes(Charset.forName("UTF-8"));
	    }
}